package com.hnevc.caoliuye;

import java.util.Scanner;

public class Homework {
    public static void main(String[] args) {
        System.out.println("请输入一个数：");//输入一个数值
        Scanner sc = new Scanner(System.in);
        int i = sc.nextInt();
        int sum = 0;
        System.out.println("在范围内可被7整除的数为：");//输出值
        for (int a = 1; a <=i ; a++) {
            if (a % 7 == 0){
                System.out.print(a +"\t");
                sum += a;
            }
        }
        System.out.print("\n");
        System.out.println("总和为："+sum);
    }
}
